# $Id: PKGBUILD 78229 2012-10-17 10:26:00Z allan $
# Maintainer: Chris Brannon <cmbrannon79@gmail.com>
# Contributor: Jeff Mickey <jeff@archlinux.org>
# Contributor: William Rea <sillywilly@gmail.com>

pkgbase=python-mpdclient2
pkgname=python2-mpdclient2
pkgver=1.0
pkgrel=4
pkgdesc="Python module for interfacing MPD"
arch=(any)
url="http://incise.org/py-libmpdclient2.html"
license=(custom)
depends=('python2')
conflicts=('python-mpdclient2<=1.0-3')
replaces=('python-mpdclient2<=1.0-3')
source=(http://incise.org/files/dev/py-libmpdclient2-1.0.tgz)
md5sums=('fd04a669f25827386a29e842a4cbcefe')

package_python2-mpdclient2() {
  cd "$srcdir/py-libmpdclient2"
  python2 setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 "COPYING.txt" \
    "$pkgdir/usr/share/licenses/$pkgname/COPYING.txt"
  find "$pkgdir" -name '*.py' -print0 |xargs -0 \
    sed -i -e 's,^#!/usr/bin/env python$,#!/usr/bin/env python2,' \
    -e 's,^#!/usr/bin/python$,#!/usr/bin/python2,'
}
